// dlg.txt

begintalkscript;

variables;

begintalknode 1;
	state = -1;
	nextstate = -1;
	condition = get_sdf(51,2) == 0 && gf(51,4) == 0;
	question = "special";
	text1 = "You approach Fort Rockfall, southernmost of the three forts of the line, the outposts that attempt to keep the rebels out of the Storm Plains.";
	text2 = "This fort is very old, long predating the arrival of the Shapers. This pass is a natural place to build a keep, so it's not surprising that soldiers have set up here since before recorded history.";
	text3 = "However, despite the clear value of its position and the impressive nature of the massive surviving walls, the Shapers have not done all they could to reinforce this keep. Most of the ancient walls have crumbled.";
	text4 = "Only the core of the keep survives, and even it is crumbling a little. General Alwan probably intends to build this place up but has not been able to spare the resources yet.";
	text5 = "A pity. If the walls were rebuilt, this place would be impregnable.";
	action = SET_SDF 51 2 1;

begintalknode 2;
	state = -1;
	nextstate = -1;
	condition = get_sdf(51,3) == 0 && gf(51,4) > 0;
	question = "special";
	text1 = "You approach Fort Rockfall, southernmost of the three forts of the line, the outposts that were trying to keep the rebels out of the Storm Plains.";
	text2 = "Thanks to your prior actions, Fort Rockfall has fallen to a surprise attack from the south. Some of the rebel attackers have slipped into the Storm Plains to cause trouble, leaving behind a pack of angry rogues.";
	text3 = "You can hear them inside the keep walls, hissing and hunting for survivors.";
	action = SET_SDF 51 3 1;

begintalknode 3;
	state = -1;
	nextstate = -1;
	condition = get_sdf(51,5) == 0 && gf(51,4) == 0;
	question = "special";
	text1 = "The east gate of Fort Rockfall has not yet been rebuilt. Instead, a far inferior defense has been set up: turrets. Reaper turrets, the most dangerous turret design, in two long rows.";
	text2 = "They will be enough to hold off a raid, but they will have no chance against a full rebel assault.";
	text3 = "When you get close, the turrets swivel and point at you. If you try to pass through this gauntlet without permission, you will get punctured.";
	action = SET_SDF 51 5 1;
	code =
		if (gf(51,6) > 0)
			rs(3);
	break;
	
begintalknode 4;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The obelisk says:";
	text2 = "  FORT ROCKFALL";
	text3 = "  ALL VISITORS REPORT DIRECTLY TO COMMANDER";

begintalknode 5;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "There is a soldier here, practicing with thorn batons. You keep from distracting her. And you keep a safe distance from her line of fire.";

begintalknode 6;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You examine this creation. It is an old specimen, the dregs of the Shaper forces, old but still barely useful. It paces around nervously and jumps at any sudden noises.";
	text2 = "Fort Rockfall's creations are painfully neglected. You're surprised that none of them have gone rogue. Yet.";


begintalknode 7;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "This is a construction servile, carrying around supplies and dedicated to completing the reconstruction of this fort. You try to start a conversation, but the servile walks by quickly, eyes cast to the ground.";
	text2 = "They must have instructions not to talk to outsiders. Or they're wise enough to not do anything that might be interpreted as disloyalty.";


begintalknode 8;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "Fort Rockfall has a number of human soldiers, poorly equipped and trained, to support its inadequate complement of creations. Several of the soldiers are old, some are conscripts, and all have low morale.";
	text2 = "Of course, this doesn't mean that they don't welcome you. Exactly the opposite. Low discipline makes them a friendly, boisterous lot. They're perfectly likable, as long as you don't have to fight beside them.";




begintalknode 10;
	state = -1;
	nextstate = 10;
	condition = 1;
	question = "Commander Rossi";
	text1 = "You meet the commander of Fort Rockfall. He is currently sitting at a desk looking at inventories of his troops and resources. The information fills him with despair.";
	text2 = "When you enter, he looks up at you. _Why are you in here? Why hasn't anyone questioned you? Why was I not told that visitors were here? Does this fortress have no security at all?_";
	text3 = "_I am Commander Rossi. I am in charge here. And, unless you have proof that you are allowed to be here, you have to go._";
	text5 = "Commander Rossi leans back in this chair, massaging his temple with his fingers. _What now? What else has gone wrong?_";
	action = INTRO;

begintalknode 11;
	state = 10;
	nextstate = -1;
	condition = gf(51,6) == 0 && has_spec_item(2) == 0;
	question = "I have papers from a member of the Shaper Council. (Show them.)";
	text1 = "Rossi takes the papers, looks them over, and hands them back with a snort. _Papers from Rawal? That is actually worse than nothing. You need to leave._";
	action = END_TALK;
	
begintalknode 12;
	state = 10;
	nextstate = -1;
	condition = gf(51,6) == 0 && has_spec_item(2) > 0;
	question = "I am here on General Alwan's behalf. (Show the amulet.)";
	text1 = "_What ... What is that? It's jewelry, not papers. Is ... Wait. He searches through his papers until he finds a sealed message. It looks like it only just arrived. He breaks the seal and reads it._";
	text2 = "_How lovely. They only bothered to get word to me about you today._";
	text3 = "_You may pass through. I won't stop you, but I don't envy you._";
	code =
		sf(51,6,1);
	break;

begintalknode 13;
	state = 10;
	nextstate = -1;
	condition = gf(51,6) > 0;
	question = "Can I get supplies while I am here?";
	text1 = "_Speak with Felicia. She is next door. I will tell her that she can trade with you._";

begintalknode 14;
	state = 10;
	nextstate = 18;
	condition = gf(51,6) > 0;
	question = "Can you tell me about the wastes to the east, and how I can pass them?";
	text1 = "He throws his hands up in the air. _The letter says that that amulet might protect you. I have no idea how. I've been told nothing._";
	text2 = "_Ask the commanders in the other forts. I'm sure they've received all the latest information!_";

begintalknode 15;
	state = 10;
	nextstate = 11;
	condition = gf(51,6) > 0;
	question = "Tell me about this fort.";
	text1 = "_Fort Rockfall. The neglected keep of the line. All the responsibility, none of the resources. Just a bunch of untrained soldiers and erratic creations, hoping the rebels don't realize how desperate we are._";
	text2 = "_But no, except for when they need to use the anvil, none of the Shapers care about us._";
	
begintalknode 16;
	state = 11;
	nextstate = -1;
	condition = 11;
	question = "Why isn't a Shaper in charge?";
	text1 = "_No idea. I would be thrilled if a Shaper replaced me. But, I suspect, none of them want to take such a difficult post._";

begintalknode 17;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "Where did you get your creations from?";
	text1 = "_Sometimes some Shapers come by and make new creations and calm the ones we already have. Then they leave, and they're gone for weeks. And we stay here with the creatures, watching them grow more and more unsteady._";
	text2 = "_I'm lucky I haven't woken up yet with a roamer's teeth in my throat._";

begintalknode 18;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "You really think the rebels could defeat you?";
	text1 = "_Look around. You tell me._";

begintalknode 19;
	state = 11;
	nextstate = 12;
	condition = gf(51,16) < 2;
	question = "Tell me about the anvil.";
	text1 = "_We have a ... I don't know what the Shapers call it. A magic anvil, something like that. Been here for centuries. One of my jobs is to look after it._";
	text2 = "_It's locked up in the southeast corner of the fort._";
	
begintalknode 20;
	state = 12;
	nextstate = 13;
	condition = 1;
	question = "Can I use it?";
	text1 = "He shakes his head. _I'm not supposed to let outsiders like me near it. Unless ... There is a service you can do for me. If you did it, I could convince any angry Shapers that you'd earned the right to be in there._";
	text2 = "";

begintalknode 21;
	state = 13;
	nextstate = -1;
	condition = gf(51,16) == 0;
	question = "Too busy. Sorry.";
	text1 = "He shrugs. _Well, the job isn't going anywhere. If you change your mind, I will be here._ He returns to work.";
	action = END_TALK;

begintalknode 22;
	state = 13;
	nextstate = 10;
	condition = 1;
	question = "What should I do?";
	text1 = "He points at your amulet. _That is Shaper work. Our scouts and advance troops wear them. It marks them as loyalists. For obvious reasons, we don't want the rebels to get them._";
	text2 = "_I've lost one. A scout went east to spy on the Bonepeak ruins. She didn't come back. She must be dead or captured by now. It's been well over a week. If you can find her amulet, I will let you use the anvil. And it will impress the Shapers._";
	code = 
		set_flag(51,16,1);
		toggle_quest(84,1);
	break;
	
begintalknode 23;
	state = 10;
	nextstate = -1;
	condition = gf(51,16) == 1 && has_spec_item(19) > 0;
	question = "Your scout is dead, but I found her amulet.";
	text1 = "This news upsets him. _I blame myself. I never should have sent her out equipped like that, but I had no choice. We don't have enough resources. I ... I keep telling them ..._";
	text2 = "_Use the anvil. I will have the door unlocked. I will make sure the Shapers learn how you have aided me. And ... Excuse me. I need some time ..._ He turns and stares at the wall, brooding about the woman he sent to her death.";
	code = 
		set_flag(51,16,2);
		toggle_quest(84,3);
		award_party_xp(200,25);
		sf(51,14,1);
		inc_flag(100,0,3);
		set_spec_item(19,-1);
	break;
	
begintalknode 24;
	state = 18;
	nextstate = -1;
	condition = get_stat(20) > 3;
	question = "Can you think of anything that might help me?";
	text1 = "_Just general advice. Stay close to the roads. When creations go rogue and become really dangerous, they leave their patrols and hide in the mountains._";

begintalknode 25;
	state = 10;
	nextstate = -1;
	condition = gf(51,16) == 1 && gf(59,1) > 0;
	question = "Your scout is dead. I found her amulet. It had been destroyed. (Lie.)";
	text1 = "Once he learns that the scout is dead, it is easy to slip past him the lie about the amulet.";
	text2 = "The news upsets him greatly. _I blame myself. I never should have sent her out equipped like that, but I had no choice. We don't have enough resources. I ... I keep telling them ..._";
	text3 = "_Use the anvil. I will have the door unlocked. I will make sure the Shapers learn how you have aided me. And ... Excuse me. I need some time ..._ He turns and stares at the wall, brooding about the woman he sent to her death.";
	code = 
		set_flag(51,16,2);
		toggle_quest(84,3);
		sf(51,14,1);
	break;
	
	
//

begintalknode 30;
	state = -1;
	nextstate = 30;
	condition = 1;
	question = "Felicia";
	text1 = "There is a beautiful and rather forlorn young woman sitting in this shop. The goods are covered with dust. She set up business here to trade with merchants passing through. Since the war started, she has endured the slow death of her shop.";
	text2 = "She jumps to her feet when you enter the store. _A customer! Greetings! I am Felicia, and I am happy to help you. Would you like to buy something? We have plenty that could help a ... a ... warrior? Like you._";
	text5 = "Felicia continues to trade with you, but her temporary burst of good cheer is starting to fade. She knows that, when you go, it's just another long run of solitude.";
	action = INTRO;

begintalknode 31;
	state = 30;
	nextstate = 31;
	condition = 1;
	question = "This is an odd place to run a shop.";
	text1 = "_I can see why you would say that. Five years ago, it seemed like a much better idea. Then ... the war._";
	text2 = "_Now hardly any merchants come here. Enough to keep me alive, but that is all._";
	
begintalknode 32;
	state = 31;
	nextstate = -1;
	condition = 1;
	question = "Why don't you go somewhere else?";
	text1 = "_Where? Everywhere has been ruined by war, or is about to be. I might as well stay here and hope. At least I'm surrounded by soldiers._";

begintalknode 33;
	state = 31;
	nextstate = -1;
	condition = 1;
	question = "How do you stay in business?";
	text1 = "_Commander Rossi helps me. He makes sure to trade with me. He uses me to scrounge up the stuff he needs for the fort, and he makes sure I make some money out of it._";
	text2 = "_I think that having me here is one of the few things that keeps him sane._";

begintalknode 34;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "Can you tell me more about this fort?";
	text1 = "_Oh, no. Commander Rossi would be angry. Only he is allowed to complain to outsiders about the fort._";

begintalknode 35;
	state = 30;
	nextstate = -1;
	condition = gf(51,6) == 0;
	question = "Can I trade with you?";
	text1 = "_I ... No, I'd better not, as much as I would like to. Not until Commander Rossi says that I can. He's next door._";

begintalknode 36;
	state = 30;
	nextstate = 32;
	condition = gf(51,6) > 0;
	question = "Can I trade with you?";
	text1 = "_Certainly. I buy supplies for the fort, and I sell other goods. What would you like?_";

begintalknode 37;
	state = 32;
	nextstate = -1;
	condition = 1;
	question = "Let me see what you have for sale.";
	text1 = "You conclude your business.";	
	code = 
		begin_shop_mode("Felicia's Shop",
		  "Felicia's goods are mostly pretty old and dusty, but she does have some items that seem useful enough.",
		  51,4,0);	
	break;

begintalknode 38;
	state = 32;
	nextstate = -1;
	condition = 1;
	question = "I have something I want to sell.";
	text1 = "You conclude your business.";	
	code = 
		begin_sell_mode();
	break;


begintalknode 39;
	state = 32;
	nextstate = 30;
	condition = 1;
	question = "I want to discuss something else.";
	text1 = "_Of course. It's good to have someone new to talk to._";

	
//

begintalknode 50;
	state = -1;
	nextstate = 50;
	condition = 1;
	question = "Thoma";
	text1 = "There is a small smithy set up here, where a lone servile is performing simple repairs on weapons and tools. He is very short, stocky and muscular. He was literally made for this sort of work.";
	text2 = "When he sees you, he puts down his hammer and gives you a little bow. He looks very nervous.";
	text3 = "_I ... I ... Welcome. I am Thoma. I greet you. Much work to do._";
	text5 = "Thoma passes his hammer nervously from hand to hand and stares at you. He is very uncomfortable.";
	action = INTRO;

begintalknode 51;
	state = 50;
	nextstate = 51;
	condition = 1;
	question = "You are the smith here?";
	text1 = "_Just a little. I ... I fix things. Make little things. Not so good. But I best commander has. I do what I can._";

	
begintalknode 52;
	state = 51;
	nextstate = -1;
	condition = 1;
	question = "Have you always been a blacksmith?";
	text1 = "_No. Was builder. But I had skill. A human saw it. I made not a builder but a smith when fort had no smith._";
	
begintalknode 53;
	state = 51;
	nextstate = -1;
	condition = 1;
	question = "Can I buy something?";
	text1 = "_Nothing ... Nothing to sell. I sorry. You talk to Felicia. She good and nice and has shop. She can sell things._";
	
begintalknode 54;
	state = 50;
	nextstate = 52;
	condition = 1;
	question = "You seem nervous. Why?";
	text1 = "_No ... No ... Not nervous. Happy to talk. Want to serve. Tell me what you want and I help._";
	
begintalknode 55;
	state = 52;
	nextstate = 53;
	condition = get_stat(20) > 3;
	question = "You can tell me. I will keep it secret. Why are you nervous?";
	text1 = "Thoma looks around and makes sure nobody is listening. _I good servile. Loyal. Like work. Like be here. But you come here, are stranger, and talk to me, and you make people think I not loyal._";
	text2 = "_So please let me work. Is what I want._";
	
begintalknode 56;
	state = 53;
	nextstate = -1;
	condition = 1;
	question = "You have no interest in escaping? Being free?";
	text1 = "Thoma looks alarmed. _No! No talk like this! I just work! Please go. Let me work._ He goes back to repairing a metal wheel.";
	action = END_TALK;
	
begintalknode 57;
	state = 53;
	nextstate = -1;
	condition = 1;
	question = "All right. I will leave you alone.";
	text1 = "_Thank you. Thank you. Now none suspect me. I am a good servile._ He goes back to repairing a metal wheel.";
	action = END_TALK;


//

begintalknode 70;
	state = -1;
	nextstate = 70;
	condition = 1;
	question = "Name";
	text1 = "There is a pack of creations here, out of missile range of the fort. They must be rebels. That's why a drakon is commanding them.";
	text2 = "The creature points at you and laughs. _Hahhhsssss. Is free prey. Free meat and treasure for mighty Tarmagan. Foolish creature coming out of fort of Shaperssss._";
	text3 = "The creations surrounding the drakon bare their fangs, ready to lunge.";

begintalknode 71;
	state = 70;
	nextstate = 71;
	condition = has_spec_item(2) > 0;
	question = "Let me by. Ghaldring wishes to see me. (Show the amulet.)";
	text1 = "The huge creature bends down and looks at the amulet. He clearly recognizes it. _Ahhhssss ... I know thissss thing. Ghaldring sendsss word. You are diplomat._";
	text2 = "_But I am Tarmagan. I do not care for diplomatsss. And Ghaldring is far, far away. I think I devour you anyway._";

begintalknode 72;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "(Run away.)";
	text1 = "You turn to run. The creatures give chase.";
	action = END_TALK;
	
begintalknode 73;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "Get out of my way, or I will destroy you.";
	text1 = "_Hsssss ... Good. Good prey. No run. No make us chase. Just fight. Is good._ Before you can respond, the drakon gives the command to attack.";
	action = END_TALK;
	
begintalknode 74;
	state = 71;
	nextstate = -1;
	condition = get_stat(20) >= 6;
	question = "You really think Ghaldring has no way to learn what happens to me?";
	text1 = "Your words shake the creature out of his greed and bloodlust. He thinks about Ghaldring, the one creature these drakons actually fear. _You ... You are right._";
	text2 = "_I let you passss, for now. When Ghaldring protectsss you no more, is wise to stay away._ The drakon turns and leaves. His creations follow.";
	action = END_TALK;
	code =
		sf(51,8,1);
		award_party_xp(100,18);
		set_attitude(1004,4);
	break;
	
begintalknode 75;
	state = 71;
	nextstate = -1;
	condition = get_stat(20) < 6;
	question = "You can't kill me. It is Ghaldring's orders.";
	text1 = "_Ghaldring! Pfaugh! He is puffed up. Strong, with lotsss of lackeysss. I am eager for one to destroy him. But the chance to defy him does not deter me. It makes me want to kill you all the more!_";
	text2 = "Tarmagan gives the word. The rogues lunge at you.";
	action = END_TALK;
	
begintalknode 76;
	state = 71;
	nextstate = -1;
	condition = 1;
	question = "Fine. I will fight you after all.";
	text1 = "_Hsssss ... Good. Good prey. No run. No make us chase. Just fight. Is good._ Before you can respond, the drakon gives the command to attack.";
	text2 = "";
	action = END_TALK;

//

begintalknode 90;
	state = -1;
	nextstate = 90;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode 91;
	state = 90;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";
		